executing DXL Script via batch using parameters

Hello,

We have to run a DXL script from

  1. batch command by passing the module name
  2. have to run the same file from a module menu.           windows command file which would look like the following...

"C:\Program Files (x86)\ibm\Rational\DOORS\9.5\bin\doors.exe" -d 36678@host -b "D:\data.dxl" -u sds -P 234 -l "D:\errors.log" -W  -cli "string t=\"/ProjectA/2\""


am checking condition that if the script executing from batch getting values like below,

Module m
 m = read(t,false)

but am getting "undeclared variable t" error when i execute the same script from DOORS module menu. can anyone help me?


muthurani - Mon Sep 01 07:45:41 EDT 2014

Re: executing DXL Script via batch using parameters
llandale - Wed Sep 03 14:02:09 EDT 2014

You're immediate problem is that your manual program has not got variable "t" defined.  You COULD put a similar "-cli" onto your doors desktop icon; but you won't know which module you want opened.

Most scripts deal with the "current" module or possibly the currently selected module "string Name = getBaseSelection_()".  I think you need to rethink the on-demand portion.

I'm thinking though you could use your envionment variables to do this.

Your batch line:

  • "-cli setenv(\"MyCleverProgram_ModuleName\", \"/ProjectA/2\")"

Your code:

  • string t = getenv("MyCleverProgram_ModuleName")

-Louie

Re: executing DXL Script via batch using parameters
Mathias Mamsch - Mon Sep 08 11:13:04 EDT 2014

I normally use something like:

noError();
string sValue = eval_ "t";
string errMsg = lastError()

if (!null errMsg) print "Symbol t not defined on global scope!";

to check for the existence of a command line parameter. If no parameter has been passed, then the script needs to handle this situation somehow.

Maybe this helps, regards, Mathias

Re: executing DXL Script via batch using parameters
Wolfgang Uhr - Tue Sep 09 10:51:47 EDT 2014

Hi

You can use an environment variable.

In the batch-File ...

SET sModuleName="ProjectA/2"
C:\Program Files (x86)\ibm\Rational\DOORS\9.5\bin\doors.exe" -d 36678@host -b "D:\data.dxl" -u sds -P 234 -l "D:\errors.log"

 

And inside of the dxl-Script

string sModuleName= getenv("sModuleName");

Best regards
Wolfgang